package com.interagriculture.controller;

import com.interagriculture.common.PageResult;
import com.interagriculture.common.Result;
import com.interagriculture.entity.Competition;
import com.interagriculture.entity.query.CompetitionQuery;
import com.interagriculture.entity.query.StudioInfoQuery;
import com.interagriculture.service.CompetitionService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Competition)表控制层
 *
 * @author makejava
 * @since 2024-10-24 19:14:15
 */
@RestController
@RequestMapping("/competition")
public class CompetitionController {
    /**
     * 服务对象
     */
    @Resource
    private CompetitionService competitionService;

    @GetMapping("/getCompetition")
    public Result<PageResult> getCompetition(@RequestBody(required = false) CompetitionQuery competitionQuery) {
        PageResult pageResult = competitionService.findCompetitionInfo(competitionQuery);
        return Result.ok(pageResult);
    }

}

